app.controller('houseOwnerLoanListDetailCtl', function($element, $scope, $state, rest, user,$rootScope,ngDialog,uiLoad  ) {
    var data = angular.copy($scope.ngDialogData, {});
    //console.log(data.orderId);

    $scope.params = {};
    $scope.$on('msg2', function(e, msg) {
            $scope.confirm({});
            console.log(msg);
    });
    rest.post({
        methodId: '4040',
        data: {
            orderId: data.orderId
        },
        success: function(res) {
          if (res.code == 0) {
            // $scope.data = res.res.data;
            $scope.dataNull = 1;
            $scope.$apply( function(){
              $scope.data = res.res.data;
            });
          }
          if(res.code == 410){
            $scope.dataNull = 0;
          }
        },
        error: function() {
          console.log( "失败！");
        }
    })
    


    $scope.repay = function (repayOrderId,repayAmount) {
        console.log(repayOrderId);
        ngDialog.openConfirm({
          template: 'js/module/fund/loanRepay.html',
          resolve: {
            load: function() {
                return uiLoad.load(['js/module/fund/loanRepay.js'])
            }
          },
          data:{
            repayAmount:repayAmount,
            repayOrderId:repayOrderId
          },
          scope: $scope,
          width: 600,
          // height: 700
        }).then(function(data) {

        }, function(reason) {

        });
    }

    $scope.display = function(e){
        document.getElementsByClassName("box")[e].style.display="block"
    }
    $scope.disappear = function(e){
        document.getElementsByClassName("box")[e].style.display="none";
    }

});
